Attention Deficit Hyperactivity Disorder (ADHD), known for low attention span and hyperactivity, has been a centre of attention in research and public discourse for a long time (Toplak et al., 2006). Following the COVID-19 pandemic, there was a notable global rise in ADHD symptoms (Rogers et al., 2023). It is thought that the pandemic lockdowns, which forced people to study and work from home, had negatively affected their attention span.
It this report, I will analyse trends in ADHD medication prescriptions in Scotland by comparing data from the pre-COVID-19 period and post-COVID-19 period. The focus is on the number of prescribed doses, which will allow us to see changes over this period. The aim of this report is to answer the question: Has there been an increase in ADHD medication prescription in Scotland that could reflect an increase in attention-related challenges following pandemic lockdowns?
The overall aim is to uncover trends in ADHD medication prescription in Scotland pre- and post-COVID-19 lockdowns. The report will show:
There are five medications that have been licensed by NHS for the treatment of ADHD in the UK. These medications are:
# if the file "prescriptions.csv" does not exist in the data folder, create it and save it into the data folder
if (!file.exists(file = here("data", "prescriptions.csv"))) {
json <- fromJSON(file = "https://www.opendata.nhs.scot/api/3/action/package_show?id=prescriptions-in-the-community")
# get all the URLs of the dataframes from the json file
urls <- data.frame(url = unlist(map(json$result$resources, function(resource){resource$url}))) %>%
# filter for dataframes that are set between January 2019 and August 2024
mutate(date = as.numeric(str_extract(url, "/pitc(\\d+)\\.csv$", group = 1))) %>%
filter(date > 201812 & date < 202409)
# read the dataframes from URLs
prescriptions <- lapply(urls$url, function(url) {
read_csv(url) %>%
clean_names() %>%
# filter for the five types of medications licensed by NHS for the treatment of ADHD
filter(str_detect(bnf_item_description, "ATOMOXETINE|DEXAMFETAMINE|GUANFACINE|LISDEXAMFETAMINE|METHYLPHENIDATE")) %>%
# change the name of the "hbt2014" column into "hbt" in dataframes from the year 2019
rename(any_of(c("hbt" = "hbt2014"))) %>%
# separate bnf_item_description string into the name of medication and its dosage
mutate(medication_name = word(bnf_item_description, sep = "[ _]"),
dose = word(bnf_item_description, start = 2, end = -1, sep = "[ _]")) %>%
select(hbt, medication_name, dose, number_of_paid_items, paid_quantity, paid_date_month)
})
# join all dataframes into one dataframe
prescriptions <- prescriptions %>%
reduce(full_join)
# save the dataframe into the data file
write_csv(prescriptions, file = here("data", "prescriptions.csv"))
} else {
prescriptions <- read.csv(here("data", "prescriptions.csv"))
}# create a function that creates a line graph with changeable y axis title, y axis type, and visibility of legend
create_graph <- function(y_title, y_type = NULL, show_legend = FALSE) {
x <- prescriptions %>%
# change paid_date_month string into date
mutate(paid_date_month = ym(paid_date_month)) %>%
# get a sum of prescribed doses of the 5 types of ADHD medications per month
group_by(medication_name, paid_date_month) %>%
summarise(paid_quantity = sum(paid_quantity)) %>%
# make an interactive plot using plotly library
plot_ly(x = ~paid_date_month,
y = ~paid_quantity,
type = "scatter",
mode = "lines",
split = ~medication_name,
color = ~medication_name,
legendgroup = ~medication_name,
showlegend = show_legend) %>%
layout(xaxis = list(title = "Date (month and year)"),
yaxis = list(title = y_title, type = y_type))
}
# create a normal graph and a log graph
overview_normal <- create_graph("Prescribed medication doses")
overview_log <- create_graph("Log of prescribed medication doses", "log", TRUE)
# join the two graphs using subplot function from plotly
subplot(overview_normal, overview_log, shareX = TRUE, titleX = TRUE, titleY = TRUE, margin = 0.05) %>%
layout(title = list(text = "<b>Number of Prescribed Doses of 5 Types of ADHD Medications from January 2019 to August 2024</b>",
font = list(color = "#483D8B", size = 14)),
hovermode = "x unified",
legend = list(orientation = 'h', y = -0.2, borderwidth = 1, bordercolor = "black", xanchor = "center", x = 0.5))The first graph shows the number of prescribed doses of each of the five ADHD medications. As Methylphenidate is clearly the most popular ADHD medication and Atomoxetine and Dexamfetamine the least popular medications, the difference makes it difficult to discern trends among the less common medication. The second graph uses a logarithmic scale for the number of doses, which enhances visibility of smaller changes within each medication. This adjustment allows clearer identification of trends that were not apparent in the first graph.
The data indicate that Methylphenidate has shown the highest increase in prescriptions over the years. Although Atomoxetine, Dexamfetamine, and Guanfacine have also seen a steady rise, their growth is not as pronounced as that of Methylphenidate. Notably, in May 2023, prescriptions for Atomoxetine and Dexamfetamine declined, coinciding with the introduction of Lisdexamfetamine to the market. This suggests that Lisdexamfetamine replaced Atomoxetine and Dexamfetamine on the market.
A key limitation of this analysis is the lack of consideration for population changes in Scotland. Population growth could be greater than the increase in ADHD medication prescriptions, potentially skewing the observed trends. To address this, a per capita analysis is necessary to provide a clearer understanding of prescription patterns relative to population dynamics.
To further explore the increase in ADHD medication prescriptions in Scotland, I will compare the number of prescribed doses before and after the COVID-19 pandemic. This analysis will also account for population differences across Scottish Health Boards. For the pre-COVID comparison, I will use 2019 population data, representing the year just before the first lockdown. For the post-COVID period, 2023 will be the reference year, as complete data for 2024 is not yet available.
# ref: https://www.opendata.nhs.scot/dataset/9f942fdb-e59e-44f5-b534-d6e17229cc7b/resource/652ff726-e676-4a20-abda-435b98dd7bdc/download/hb14_hb19.csv
hb_names <- read_csv(here("data", "hb_names.csv")) %>%
clean_names() %>%
select(hb, hb_name)
# ref: https://www.opendata.nhs.scot/dataset/7f010430-6ce1-4813-b25c-f7f335bdc4dc/resource/27a72cc8-d6d8-430c-8b4f-3109a9ceadb1/download/hb2019_pop_est_14102024.csv
hb_population <- read_csv(here("data", "hb_population.csv")) %>%
clean_names() %>%
filter(sex == "All") %>%
select(year, hb, all_ages)
# ref: https://spatialdata.gov.scot/geonetwork/srv/api/records/f12c3826-4b4b-40e6-bf4f-77b9ed01dc14
NHS_healthboards <- st_read(here("data", "NHS_healthboards_2019.shp")) %>%
clean_names()map_data <- prescriptions %>%
# change paid_date_month string into a number relating to the year a prescription was made
mutate(paid_date_month = year(ym(paid_date_month))) %>%
full_join(hb_population, by = c("hbt" = "hb", "paid_date_month" = "year")) %>%
# filter for data from 2019 and 2023 and filter out unwanted health boards
filter(paid_date_month %in% c("2019", "2023"),
!(hbt %in% c("S92000003", "S08000021", "S08000023"))) %>%
# get a sum of prescribed doses of ADHD medications for each health board per year
group_by(hbt, all_ages, paid_date_month) %>%
summarise(paid_quantity = sum(paid_quantity)) %>%
# calculate the ratio of prescribed doses per population
mutate(ratio = paid_quantity / all_ages) %>%
full_join(NHS_healthboards, by = c("hbt" = "hb_code"))I excluded the health boards S92000003,
S08000021, and S08000023 from the dataframe.
S92000003 represents ambulance services and is not relevant
to this analysis. Meanwhile, S08000021 and
S08000023 correspond to the inactive
Greater Glasgow and Clyde and Lanarkshire Health Boards, which have been
replaced by S08000031 and S08000032,
respectively.
# create a figure with two maps
map_figure <- map_data %>%
ggplot(aes(fill = ratio, geometry = geometry, text = paste(hb_name, "had a ratio of", format(ratio, digits = 2), "in", paid_date_month))) +
geom_sf(lwd = 0.1) +
# set a colour palette
scale_fill_distiller(palette = 16, direction = 1) +
facet_wrap(~paid_date_month) +
labs(title = "Prescribed Doses of ADHD Medications per Health Board Populations") +
theme_void() +
theme(plot.title = element_text(size=11, face = "bold", color = "#483D8B"))
# display the figure as an interactive map using ggplotly function from plotly package
map_figure %>%
ggplotly(tooltip = "text") %>%
style(hoverlabel = list(bgcolor = "white"), hoveron = "fill")The maps represent the ratio of prescribed doses of ADHD medications relative to the population of each Health Board in 2019 and 2023. By comparing these two maps, we can identify any increases in the ratio, which would indicate a rise in the number of prescribed doses. The ratio is calculated as:
\[\begin{align*} \text{ratio} & = \frac{\text{number of prescribed doses in health board}}{\text{population of health board}} \\ \end{align*}\]
The ratio of prescribed ADHD medication doses to population has increased in most Health Boards across Scotland. The only exception is Tayside, where the ratio decreased from \(1.02\) to \(0.904\). Grampian currently has the highest ratio, with \(1.33\) doses prescribed per person, indicating a significant concentration of ADHD medication prescriptions in this region.
A limitation of this figure is that it does not clearly illustrate the magnitude of change across individual Health Boards. While it shows that prescriptions increased overall, it does not indicate whether the increase was substantial or minimal for each Health Board. Additionally, it highlights which Health Board has the highest or lowest ratio of doses per person but does not reveal which experienced the largest or smallest increase over time without manual calculations.
To account for changes in the ratios over time, I calculated a change for each Health Board by dividing the 2023 ratios by the 2019 ratios. This approach highlights the magnitude of change in prescribed doses relative to population between the two time periods.
change_plot <- map_data %>%
ungroup() %>%
# create columns ratio_2019 and ratio_2023, and add ratio values to columns according to the year
pivot_wider(names_from = paid_date_month, values_from = ratio,
names_prefix = "ratio_") %>%
# aggregate ratio_2019 and ratio_2023 to get the first non-NA value for each health board
group_by(hb_name) %>%
summarize(ratio_2019 = first(na.omit(ratio_2019)),
ratio_2023 = first(na.omit(ratio_2023))) %>%
# calculate change of ratios of prescribed doses per person
mutate(change = ratio_2023 / ratio_2019) %>%
# create a bar plot with a logarithmic scale
ggplot(aes(x = reorder(hb_name, change), y = change, text = paste(hb_name, " has a ", format(change, digits = 2, trim = TRUE), "-fold change", sep = ""))) +
geom_col() +
scale_y_log10() +
labs(title = "Change in Ratio of Prescribed Doses of ADHD Medications per Health Board Population", x = "Health Board Names", y = "Change in ratio between year 2019 and 2023") +
theme_bw() +
theme(plot.title = element_text(size = 10.5, face = "bold", color = "#483D8B", hjust = 0.5),
axis.text.x = element_text(angle = 30, vjust = 0.5, hjust=1))
# display an interactive bar plot using ggplotly function from plotly package
change_plot %>%
ggplotly(tooltip = "text")The bar plot illustrates the change in the ratio of prescribed doses per person between 2019 and 2023 for each Health Board, displayed on a logarithmic scale. This scaling was chosen to accommodate the wide variation in changes, with the Western Isles showing a significant increase, while Tayside and Orkney experienced much smaller changes, making differences harder to discern on a linear scale.
As noted earlier, all Health Boards experienced an increase in prescribed doses per person, except for Tayside. The Western Isles, in particular, saw a remarkable rise, with the 2023 ratio nearly 13 times higher than in 2019. This dramatic increase is noteworthy given its small population of approximately 26,000 residents.
The next step will focus on a detailed analysis of NHS Lothian, as I live in Edinburgh and have a particular interest in this Health Board. I plan to examine the data more closely to determine which of the five ADHD medications is the most commonly prescribed in this region. Additionally, I will analyze the data to identify the most frequently prescribed dosages for each medication, providing a deeper understanding of prescription trends within NHS Lothian.
past_year_prescriptions <- prescriptions %>%
# filter for data from September 2023 to August 2024
filter(paid_date_month > 202308 & paid_date_month < 202409) %>%
full_join(hb_names, by = c("hbt" = "hb")) %>%
full_join(hb_population %>% filter(year == "2023"), by = c("hbt" = "hb")) %>%
# filter for data from NHS Lothian
filter(hb_name == "NHS Lothian") %>%
# get a sum of paid items and prescribed doses for each ADHD medication and dosage
group_by(medication_name, dose, all_ages) %>%
summarise(paid_quantity = sum(paid_quantity),
number_of_paid_items = sum(number_of_paid_items)) %>%
# calculate number of prescribed doses per 10,000 people
mutate(paid_quantity = (paid_quantity / all_ages) * 10000,
number_of_paid_items = (number_of_paid_items / all_ages) * 10000) %>%
ungroup()
past_year_prescriptions %>%
select(medication_name, dose, number_of_paid_items, paid_quantity) %>%
# get top three most prescribed dosages of each type of ADHD medication
group_by(medication_name) %>%
slice_max(paid_quantity, n = 3) %>%
arrange(desc(paid_quantity)) %>%
# create table using gt package
gt() %>%
# set text and style of title and subtitle
tab_header(title = "Top 3 Most Prescribed ADHD Medications of Each Type in The Past Year",
subtitle = "Data from NHS Lothian") %>%
tab_style(style = cell_text(weight = "bold", color = "#483D8B"),
locations = list(cells_title(groups = "title"), cells_row_groups(groups = everything()))) %>%
# set text and style for spanner column label
tab_spanner(label = "Rate per 10k population",
columns = c(number_of_paid_items, paid_quantity)) %>%
tab_style(style = cell_text(style = "italic"),
locations = cells_column_spanners(spanners = everything())) %>%
# set names for columns displayed in table
cols_label(dose = "Dose",
number_of_paid_items = "Number of Paid Items",
paid_quantity = "Number of Prescriptions") %>%
# format numbers to have 2 decimal places
fmt_number(columns = c(number_of_paid_items, paid_quantity), decimals = 2) %>%
# add average and overall average in table
summary_rows(columns = c(number_of_paid_items, paid_quantity),
fns = list("Average" = ~mean(., na.rm = TRUE)),
fmt = list(~ fmt_number(., decimals = 2))) %>%
grand_summary_rows(columns = c(number_of_paid_items, paid_quantity),
fns = list("Overall Average" = ~mean(., na.rm = TRUE)),
fmt = list(~ fmt_number(., decimals = 2))) %>%
# add stripes to rows for better readability
opt_row_striping()| Top 3 Most Prescribed ADHD Medications of Each Type in The Past Year | |||
| Data from NHS Lothian | |||
| Dose |
Rate per 10k population
|
||
|---|---|---|---|
| Number of Paid Items | Number of Prescriptions | ||
| METHYLPHENIDATE | |||
| 10MG TABLETS | 50.06 | 3,466.82 | |
| 5MG TABLETS | 37.28 | 2,327.26 | |
| 20MG TABLETS | 15.41 | 1,099.76 | |
| Average | — | 34.25 | 2,297.95 |
| DEXAMFETAMINE | |||
| 5MG TABLETS | 15.19 | 1,560.51 | |
| 5MG/5ML ORAL SOLUTION SUGAR FREE | 0.22 | 34.27 | |
| 5MG/5ML ORAL LIQUID | 0.02 | 4.90 | |
| Average | — | 5.14 | 533.23 |
| ATOMOXETINE | |||
| 40MG CAPSULES | 7.62 | 287.83 | |
| 60MG CAPSULES | 5.16 | 205.38 | |
| 10MG CAPSULES | 3.45 | 191.70 | |
| Average | — | 5.41 | 228.30 |
| LISDEXAMFETAMINE | |||
| 30MG CAPSULES | 0.05 | 2.13 | |
| 40MG CAPSULES | 0.05 | 1.52 | |
| 50MG CAPSULES | 0.02 | 0.61 | |
| Average | — | 0.04 | 1.42 |
| GUANFACINE | |||
| 1MG MODIFIED-RELEASE TABLETS | 0.01 | 0.61 | |
| 3MG MODIFIED-RELEASE TABLETS | 0.01 | 0.61 | |
| Average | — | 0.01 | 0.61 |
| Overall Average | — | 9.61 | 655.99 |
The table shows the three most commonly prescribed dosages for each ADHD medication. The medications are listed in descending order based on total prescriptions per 10k population, with Methylphenidate being the most frequently prescribed. Its most common dosage is 10 mg tablets. In contrast, Guanfacine is the least prescribed ADHD medication, with only two available dosages, which is why it has only 2 entries in the table.
Most of the prescribed medications are in tablet or capsule form. However, Dexamfetamine stands out, as its top three prescribed dosages include oral solution and oral liquid options in addition to tablets.
This report demonstrated a consistent increase in the overall prescription of ADHD medication doses in Scotland between January 2019 and August 2024. When considering the number of doses per person in each Health Board, all except Tayside showed an increase between 2019 and 2023. The Western Isles had the most significant change, with a nearly 13-fold increase, followed by the Shetlands with an almost 3-fold increase—a striking difference between the largest and second-largest changes. Additionally, the most commonly prescribed dosages of ADHD medications in the Lothian area were examined, as this region is of personal interest due to me living Edinburgh. The most prescribed medication was Methylphenidate and the least prescribed was Dexamfetamine.
The answer to the research question is complex. While there was a clear increase in prescribed doses per person between the pre- and post-COVID-19 lockdown periods, it is difficult to attribute this trend solely to the pandemic. The increase may represent a continuation of a pre-existing upward trend, although the lockdowns might have accelerated this growth. A more comprehensive analysis comparing the rate of increase between earlier periods (e.g., 2015 to 2019) and recent years (2019 to 2023) would help clarify this hypothesis. However, such an analysis would require processing approximately 120 datasets, which presents logistical challenges.
It is also important to note that ADHD medication prescription trends do not necessarily reflect the true prevalence of ADHD symptoms in Scotland. Many individuals diagnosed with ADHD do not receive medication, and others remain undiagnosed due to long waiting lists for assessments. For instance, the average waiting time for an ADHD diagnosis in Edinburgh is currently 23.5 months, according to the Lothian NHS Board. Future research could expand this analysis by exploring additional factors influencing ADHD diagnosis and treatment, providing a deeper understanding of how the pandemic may have impacted ADHD symptoms and healthcare responses in Scotland.
Lothian NHS Board. (2024) Freedom of Information - ADHD. Available at: https://org.nhslothian.scot/foi/wp-content/uploads/sites/22/2024/06/8722.pdf
NHS. (2021) Attention Deficit Hyperactivity Disorder (ADHD) - Treatment - NHS. Available at: https://www.nhs.uk/conditions/attention-deficit-hyperactivity-disorder-adhd/treatment/
Rogers, M.A. and MacLean, J. (2023) ‘ADHD symptoms increased during the COVID-19 pandemic: A meta-analysis’, Journal of Attention Disorders, 27(8), pp. 800–811. doi:10.1177/10870547231158750.
Toplak, M.E., Dockstader, C., Tannock, R. (2006) ‘Temporal information processing in ADHD: Findings to date and New Methods’, Journal of Neuroscience Methods, 151(1), pp. 15–29. doi:10.1016/j.jneumeth.2005.09.018.